Skip to content

Remove leaf_customer_span_id baggage re-parenting hack from tracing#46085

Open
needuv wants to merge 89 commits intomainfrom
needuv/remove-leaf-customer-span-id
Open

Remove leaf_customer_span_id baggage re-parenting hack from tracing#46085
needuv wants to merge 89 commits intomainfrom
needuv/remove-leaf-customer-span-id

Conversation

@needuv
Copy link
Copy Markdown
Member

@needuv needuv commented Apr 2, 2026

Use standard OTel traceparent propagation instead of overriding the parent span ID via the baggage header's leaf_customer_span_id key.

  • Remove _parse_baggage_key() and _override_parent_span_id() helpers
  • Remove baggage_header parameter from span/start_span/_extract_context
  • Simplify _prepare_request_span_args to return 3-tuple (no baggage)
  • Remove associated tests (TestParseBaggageKey, test_baggage_leaf_customer_span_id)
  • Preserve set_baggage/detach_baggage OTel context API (unrelated)

Description

Please add an informative description that covers that changes made by the pull request and link all relevant issues.

If an SDK is being regenerated based on a new API spec, a link to the pull request containing these API spec changes should be included above.

All SDK Contribution checklist:

  • The pull request does not introduce [breaking changes]
  • CHANGELOG is updated for new features, bug fixes or other significant changes.
  • I have read the contribution guidelines.

General Guidelines and Best Practices

  • Title of the pull request is clear and informative.
  • There are a small number of commits, each of which have an informative message. This means that previously merged commits do not appear in the history of the PR. For more information on cleaning up the commits in your PR, see this page.

Testing Guidelines

  • Pull request includes test coverage for the included changes.

lusu-msft and others added 30 commits March 17, 2026 13:03
- added type spec model generation
- add model validator generation
- creating a server
* trying

* generate contract models

* add validator generator

* fix model generation

* add more unit tests

* fix conflict

* refined model generation
* trying

* generate contract models

* add validator generator

* fix model generation

* add more unit tests

* fix conflict

* refined model generation

* renamed the pacakge
* create response

* cancel and delete

* fix options
lusu-msft and others added 21 commits March 30, 2026 12:51
Per updated container spec, agentservice expects /readiness.
Updated route, method name, docstrings, README, samples, and
all tests across -core, -invocations, and -responses.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
The latest opentelemetry-sdk added _on_ending to the SpanProcessor
interface, causing AttributeError at runtime. Add the required no-op
method to fix compatibility.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…_id resolution and stamping)

Agent-Logs-Url: https://github.com/Azure/azure-sdk-for-python/sessions/40114cbe-e583-4912-abc7-75c551a7e12c

Co-authored-by: ankitbko <3169316+ankitbko@users.noreply.github.com>
… private imports, simplify model access in samples

Agent-Logs-Url: https://github.com/Azure/azure-sdk-for-python/sessions/40114cbe-e583-4912-abc7-75c551a7e12c

Co-authored-by: ankitbko <3169316+ankitbko@users.noreply.github.com>
…n hint priority, add invalid header test

Agent-Logs-Url: https://github.com/Azure/azure-sdk-for-python/sessions/40114cbe-e583-4912-abc7-75c551a7e12c

Co-authored-by: ankitbko <3169316+ankitbko@users.noreply.github.com>
* update otel

* refined readme

* updated model validator

* fix model
…cing dupe protection

Thread 17: Replace ErrorResponse.create() with create_error_response() and
AgentLogger.get() with get_logger() module-level functions. Updated all call
sites across core, invocations, and responses packages.

Thread 18: Added Breaking Changes section to CHANGELOG.md documenting the API
renames, removed constants, and health endpoint rename.

Thread 21: Added module-level sentinel flags to _setup_trace_export,
_setup_log_export, _setup_otlp_trace_export, and _setup_otlp_log_export to
prevent duplicate exporters across multiple TracingHelper instantiations.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…ider

Migrated FoundryStorageProvider from raw httpx.AsyncClient to
azure.core.AsyncPipelineClient, gaining built-in retry, logging,
distributed tracing, and bearer-token authentication via
AsyncBearerTokenCredentialPolicy.

- Removed manual _auth_headers() — handled by pipeline policy
- Removed http_client constructor parameter — pipeline is internal
- Updated _foundry_errors.py to use azure.core.rest.HttpResponse
- Removed httpx from pyproject.toml dependencies
- Updated all unit tests to mock send_request instead of httpx methods

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
CreateResponse always has a model attribute, so the defensive
getattr is unnecessary boilerplate.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Responses package has been split into a separate PR on the
agentserver/responses branch for independent review and iteration.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…langgraph from main

These packages were inadvertently removed in an earlier commit.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…ly (#46069)

Add set_current_span/detach_context to TracingHelper so the invoke_agent
span is attached as the active OTel context span. This ensures child spans
created by framework handlers are parented under invoke_agent instead of
appearing as siblings.

- TracingHelper.set_current_span() attaches the span to context
- TracingHelper.detach_context() restores the previous context
- InvocationHandler propagates span_token through both streaming and
  non-streaming cleanup paths
- Added test_span_parenting.py to verify parent-child relationship

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Use standard OTel traceparent propagation instead of overriding the
parent span ID via the baggage header's leaf_customer_span_id key.

- Remove _parse_baggage_key() and _override_parent_span_id() helpers
- Remove baggage_header parameter from span/start_span/_extract_context
- Simplify _prepare_request_span_args to return 3-tuple (no baggage)
- Remove associated tests (TestParseBaggageKey, test_baggage_leaf_customer_span_id)
- Preserve set_baggage/detach_baggage OTel context API (unrelated)

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@needuv needuv requested review from JC-386 and lusu-msft as code owners April 2, 2026 15:26
@github-actions github-actions bot added the Hosted Agents sdk/agentserver/* label Apr 2, 2026
Base automatically changed from agentserver/invoke-reponses to main April 4, 2026 02:01
@pvaneck pvaneck requested review from lmazuel, msyyc and scbedd as code owners April 4, 2026 02:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Hosted Agents sdk/agentserver/*

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants